<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title th:text="${movie.name} + ' - 电影详情'">电影详情</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css">
    <style>
        .movie-poster {
            max-height: 500px;
            object-fit: cover;
        }
        .section-title {
            margin: 30px 0 20px;
            padding-bottom: 10px;
            border-bottom: 1px solid #eee;
        }
    </style>
</head>
<body>
    <nav class="navbar navbar-expand-lg navbar-dark bg-dark">
        <div class="container">
            <a class="navbar-brand" href="/">电影系统</a>
            <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
                <span class="navbar-toggler-icon"></span>
            </button>
            <div class="collapse navbar-collapse" id="navbarNav">
                <ul class="navbar-nav">
                    <li class="nav-item">
                        <a class="nav-link" href="/">首页</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="/movie/list">电影列表</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="/user/list">用户管理</a>
                    </li>
                </ul>
            </div>
        </div>
    </nav>

    <div class="container mt-4">
        <div class="row">
            <div class="col-md-4">
                <img th:src="${movie.photo}" class="img-fluid movie-poster" alt="电影海报">
            </div>
            <div class="col-md-8">
                <h2 th:text="${movie.name}">电影名称</h2>
                <div class="mb-3">
                    <span class="badge bg-primary me-2" th:text="'类型: ' + ${movie.types}">类型</span>
                    <span class="badge bg-info me-2" th:text="'价格: ￥' + ${movie.price}">价格</span>
                    <span class="badge bg-success" th:text="'点击数: ' + ${movie.clickNum}">点击数</span>
                </div>

                <div class="section-title">电影简介</div>
                <p th:text="${movie.description}">电影简介内容</p>

                <div class="section-title">上映时间</div>
                <p th:text="${#dates.format(movie.createTime, 'yyyy-MM-dd HH:mm:ss')}">上映时间</p>

                <div class="mt-4">
                    <a href="/movie/list" class="btn btn-secondary">返回列表</a>
                    <a th:href="@{'/movie/edit/' + ${movie.id}}" class="btn btn-primary">编辑电影</a>
                </div>
            </div>
        </div>
    </div>

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>
